/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


var Fun = {
    // 初始 ---------------------------
    init: function(){
        Fun.render();
        Fun.register();
    },
    
    register: function(){
        $("#showKyes").bind("click", Fun.showKeys);
    },
    
    // 逻辑 ---------------------------
    render: function(){
        var data = Sender.send("rest/", "GET", {});
        $("body").html(TemplateEngine.render($("body").html(), data));
    },
    
    showKeys: function(){
        var data = Sender.send("rest/kong", "GET", {});
        $("#keys").html(TemplateEngine.render(Tpl.keys, data));
    }
};

window.onload = Fun.init;